import { createBrowserRouter } from 'react-router-dom';
import Layout from '@layout/Layout';
import HomePage from '@views/HomePage/index';
import DataStatisticsPage from '@views/DataStatisticsPage/index';
import UserStatistics from '@views/DataStatisticsPage/UserStatistics/index';
import SalesStatistics from '@views/DataStatisticsPage/SalesStatistics/index';
import TrafficStatistics from '@views/DataStatisticsPage/TrafficStatistics/index';
import SystemManagementPage from '@views/SystemManagementPage/index';
import UserManagement from '@views/SystemManagementPage/UserManagement/index';
import RoleManagement from '@views/SystemManagementPage/RoleManagement/index';
import PermissionManagement from '@views/SystemManagementPage/PermissionManagement/index';
import MessageCenterPage from '@views/MessageCenterPage/index';
import NotFoundPage from '@views/NotFoundPage/index';
import UserProfile from '@views/my/UserProfile';

// 创建路由配置
const router = createBrowserRouter([
  {
    path: '/',
    element: <Layout>
      <HomePage />
    </Layout>,
  },
  {
    path: '/home',
    element: <Layout>
      <HomePage />
    </Layout>,
  },
  {
    path: '/data-statistics',
    element: <Layout>
      <DataStatisticsPage />
    </Layout>,
  },
  {
    path: '/data-statistics/user',
    element: <Layout>
      <UserStatistics />
    </Layout>,
  },
  {
    path: '/data-statistics/sales',
    element: <Layout>
      <SalesStatistics />
    </Layout>,
  },
  {
    path: '/data-statistics/traffic',
    element: <Layout>
      <TrafficStatistics />
    </Layout>,
  },
  {
    path: '/system-management',
    element: <Layout>
      <SystemManagementPage />
    </Layout>,
  },
  {
    path: '/system-management/user',
    element: <Layout>
      <UserManagement />
    </Layout>,
  },
  {
    path: '/system-management/role',
    element: <Layout>
      <RoleManagement />
    </Layout>,
  },
  {
    path: '/system-management/permission',
    element: <Layout>
      <PermissionManagement />
    </Layout>,
  },
  {
    path: '/message-center',
    element: <Layout>
      <MessageCenterPage />
    </Layout>,
  },
  {
    path: '/user-profile',
    element: <Layout>
      <UserProfile />
    </Layout>,
  },
  // 通配符路由，处理未匹配的路径
  {
    path: '*',
    element: <Layout>
      <NotFoundPage />
    </Layout>,
  },
]);

export default router;